<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.oreilly.servlet.MultipartRequest" %>
<%@ page import="com.oreilly.servlet.multipart.DefaultFileRenamePolicy" %>
<%@ page import="java.io.File" %>
<%
String uploadPath = "C:/applications/upload";
int sizeLimit = 5 * 1024 * 1024;	// 5MB

MultipartRequest mr = new MultipartRequest(
		request, uploadPath,
		sizeLimit, "UTF-8", new DefaultFileRenamePolicy());

File file = mr.getFile("fileA");
String fileName = file.getName();
long fileSize = file.length();
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>multipart upload jsp</title>
</head>
<body>
<%
if (fileName == null) {
	out.print("파일 업로드 실패!");
} else {
	out.print("파일명  :" + fileName + "<br/>");
	out.print("파일크기:" + fileSize + "<br/>");
	out.print("설명    :" + mr.getParameter("desc"));
}
%>
</body>
</html>